package com.framework.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.framework.entity.aliPay.AliPayConfig;
import com.framework.entity.sys.SysAddress;
import com.framework.entity.tran.TranOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 *
 * @author wq
 */
public interface TranOrderDao extends BaseMapper<TranOrder> {

    /**
     *根据agentId和订单状态查列表
     * @param agentId
     * @param orderState
     * @return
     */
    List<TranOrder> queryOrdersList(@Param("agentId") Long agentId, @Param("orderState")Integer orderState);

    /**
     *  团队购买订单数量
     * @param agentId
     * @param type
     * @param isOwn
     * @return
     */
    Integer queryTeamBuyTerCount(@Param("agentId") Long agentId, @Param("type") Integer type, @Param("isOwn") Integer isOwn);

    /**
     * 查询支付配置
     * 根据渠道查询支付配置
     * @param deptId
     * @return
     */
    AliPayConfig queryAliPayConfig(@Param("deptId") Long deptId);

    /**
     *分页查询
     * @param params
     * @return
     */
    List<Map<String, Object>> queryList(Map<String, Object> params);

    /**
     *查询数量
     * @param params
     * @return
     */
    Integer queryCount(Map<String, Object> params);

    /**
     *查询地址
     * @param orderId
     * @return
     */
    SysAddress queryAddressByOrderId(@Param("orderId") String orderId);

    /**
     *查询订单详情
     * @param orderId
     * @return
     */
    List<Map<String, Object>> queryNoticeDetail(@Param("orderId")Long orderId);

    /**
     * 根据id
     * @param agentId
     * @param goodsId
     * @return
     */
    List<Map<String,Object>> queryOrderListByAgentIdAndGoodsId(Long agentId, Long goodsId);

    /**
     * 获取积分订单
     * @param agentId
     * @param orderState
     * @return
     */
    List<TranOrder> getIntegralOrders(@Param("agentId") Long agentId,@Param("orderState") Integer orderState);

}
